<template>
  <div>

    <item-title title="发货信息" />

    <el-form label-position="right" size="small" label-width="100px">

      <el-row>

        <el-col :span="8">
          <el-form-item label="订单编号：">
            {{ order.order.orderNumber }}
          </el-form-item>

        </el-col>

        <el-col :span="8">

          <el-form-item label="发货日期：">
            <span v-if="datas.delivery.deliveryTime">{{ dateFormat('yyyy-mm-dd',datas.delivery.deliveryTime) }}</span>
          </el-form-item>
        </el-col>

        <el-col :span="8">

          <el-form-item label="操作人：">
            {{ datas.delivery.deliveryUserName }}
          </el-form-item>

        </el-col>

        <el-col :span="8">

          <el-form-item label="配送物流：">
            {{ datas.delivery.logistics }}
          </el-form-item>

        </el-col>

        <el-col :span="8">

          <el-form-item label="物流单号：">
            {{ datas.delivery.logisticsNo }}
          </el-form-item>

        </el-col>

        <el-col :span="8">

          <el-form-item label="操作时间：">
            <span v-if="datas.delivery.createdAt">{{ dateFormat('yyyy-mm-dd HH:MM',datas.delivery.createdAt) }}</span>
          </el-form-item>

        </el-col>

        <el-col :span="8">

          <el-form-item label="随货清单：">
            <div v-if="datas.delivery.accompanyingList">
              <span v-for="(str,index) in datas.delivery.accompanyingList.split(',')" :key="index" style="margin-right: 10px">{{ getLabel('goods_list',str) }}</span>
            </div>
            <div v-else>无</div>

          </el-form-item>

        </el-col>

      </el-row>

    </el-form>

    <item-title title="发货产品明细" />

    <el-table border="" :data="datas.deliveryDetail" header-cell-class-name="table-header">
      <el-table-column
        type="index"
      />
      <el-table-column
        header-align="center"
        align="left"
        prop="productPopularName"
        label="产品通用名"
        min-width="150"
        show-overflow-tooltip
      />
      <el-table-column
        header-align="center"
        align="center"
        prop="productName"
        label="商品名"
        show-overflow-tooltip
      />
      <el-table-column
        header-align="center"
        align="center"
        prop="packSpecs"
        label="包装规格"
        show-overflow-tooltip
      />
      <el-table-column
              header-align="center"
              align="center"
              prop="producer"
              label="生产厂家"
              show-overflow-tooltip
      />
      <el-table-column
        header-align="center"
        align="center"
        prop="putNumber"
        label="下单数量"
      >
        <template #default="scope">
          {{ scope.row.putNumber }}{{ getLabel('sell_unit',scope.row.sellUnit) }}
        </template>
      </el-table-column>
      <el-table-column
        header-align="center"
        align="center"
        prop="batchNumber"
        label="批号"
      />
      <el-table-column
        header-align="center"
        align="center"
        prop="deliveryNumber"
        label="本次发货数量"
      >
        <template #default="scope">
          {{ scope.row.deliveryNumber }}{{ getLabel('sell_unit',scope.row.sellUnit) }}
        </template>
      </el-table-column>

    </el-table>

  </div>
</template>

<script>
import {defineComponent} from 'vue'

export default defineComponent({
  name: 'DeliveryDetailView',
  props: {
    datas: {
      type: Object,
      default: {}
    },
    order: {
      type: Object,
      default: {}
    }
  },
  setup() {
    return {

    }
  }
})
</script>

<style scoped>

</style>
